<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:template match="/">
        <data jsxid="jsxroot">
          <xsl:for-each select="data/record">
            <xsl:sort select="missingSRDefName" order="ascending"/>
			<xsl:if test="record">
				<record>
					<xsl:attribute name="jsxid">
						<xsl:value-of select="@jsxid"/>
					</xsl:attribute>
					<xsl:attribute name="respEntityID">
						<xsl:value-of select="@respEntityID"/>
					</xsl:attribute>
					<xsl:attribute name="respName">
						<xsl:value-of select="@respName"/>
					</xsl:attribute>
					<xsl:attribute name="respSuccess">
						<xsl:value-of select="@respSuccess"/>
					</xsl:attribute>
					<xsl:attribute name="missingSRDefName">
						<xsl:value-of select="@missingSRDefName"/>
					</xsl:attribute>
					<xsl:attribute name="missingSRDefEntityID">
						<xsl:value-of select="@missingSRDefEntityID"/>
					</xsl:attribute>
					<xsl:attribute name="missingNodeName">
						<xsl:for-each select="record">
							   <xsl:value-of select="@missingNodeName" />
							   <xsl:if test="position() !=last()">,</xsl:if>
						</xsl:for-each>
					</xsl:attribute>
					<xsl:attribute name="missingNodeEntityID">
						<xsl:for-each select="record">
							   <xsl:value-of select="@missingNodeEntityID" />
							   <xsl:if test="position() !=last()">,</xsl:if>
						</xsl:for-each>
					</xsl:attribute>
				</record>
			</xsl:if>
          </xsl:for-each>
        </data>
  </xsl:template>
</xsl:stylesheet>
